package com.lej.my.service

import com.alibaba.android.arouter.facade.annotation.Route
import com.lej.core.base.BaseFragment
import com.lej.core.common.PCacheInfo
import com.lej.core.common.WEB_SHOW_TITLE
import com.lej.core.common.WEB_URL
import com.lej.core.router.CRouter
import com.lej.core.utils.extention.addUrlParams
import com.lej.core.utils.extention.router
import com.lej.dataservice.club.http.base.HttpUrl
import com.lej.my.BR
import com.lej.my.R
import com.lej.my.databinding.MyFragmentServiceBinding
import com.qmuiteam.qmui.kotlin.onClick

/**
 *  author: cjq
 *  date  : 2022/6/9 0009
 *  desc  :
 */
@Route(path = CRouter.myService)
class MyServiceFragment : BaseFragment<MyFragmentServiceBinding, MyServiceViewModel>() {
    override fun getLayout(): Int = R.layout.my_fragment_service

    override fun initVariableId(): Int = BR.vm

    override fun initData() {
        super.initData()
        val url = HttpUrl.FEED_BACK_URL.addUrlParams("nickname" to PCacheInfo.nick,"avatar" to PCacheInfo.headImg,"openid" to PCacheInfo.userId)
        binding.tvFeedback.onClick {
            router(CRouter.webView){
                withString(WEB_URL, url)
                withBoolean(WEB_SHOW_TITLE, false)
            }
        }
    }

}